<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绝对定位</title>
    <style>
        .container{
            width: 1000px;
            height: 500px;
            margin: 100px 200px;
            border: 1px solid red;
            position: absolute;
        }
        div{
            width: 200px;
            height: 100px;
        }
        .c1{
            background-color: red;
            position: absolute;
            z-index: 1;
            left: 200px;
        }
        .c2{
            background-color: green;
            position: absolute;
            z-index: 2;
            top: 100px;
        }
        .c3{
            background-color: blue;
            position: absolute;
            z-index: 3;
            left: 200px;
            top: 200px;
        }
        .c4{
            background-color: purple;
            position: absolute;
            z-index: 4;
            left: 400px;
            top: 100px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="c1"></div>
    <div class="c2"></div>
    <div class="c3"></div>
    <div class="c4"></div>
</div>
</body>
</html>